const defaultState = {
    menuList: []
}  //默认数据



export default (state = defaultState, action) => {  //就是一个方法函数
    switch (action.type) {
        case 'add':
            const arr = [].concat(state.list, [action.value * 1])
            return {
                list: [...arr]
            }
        case 'initMenu':
            const menuList = [].concat(action.value)
            return {
                menuList
            }
        default:
            return state;
    }
}
